
<?php
//session_start();
ob_start();
include ("Connect_To_Database.php");
$strMode = $_POST["SelectMode"];
$USER_ID = $_POST["USER_ID"];
$PASSWORD = $_POST["PASSWORD"];
$PASSMD5 = md5($PASSWORD);


if ($strMode == 'COOKIE') {
    $strSQL = "SELECT * FROM giswebdatabase WHERE USER_ID = '$USER_ID' and PASSWORD = '$PASSMD5'";
    $objQuery = mysql_query($strSQL);
    $row = mysql_num_rows($objQuery);
}
if ($row == 1) {
     //setcookie("USER_ID", $USER_ID, time() + 10);
    setcookie('PASSWORD', $PASSMD5, time() + 10);
    echo(1);
} else {
    echo(2);
}
?>
